package com.foreknow.demo12;

import java.util.*;

public class NBADemo {
    public static void main(String[] args) {
        Random rand = new Random();
        List<String> list = new ArrayList<>();
        String[] nba = {"骑士", "勇士", "湖人", "热火", "老鹰", "猛龙", "篮网",
                "凯尔特人", "小牛", "活塞", "公牛", "魔术", "爵士", "开拓", "火箭","huojian"};
        for (String str : nba) {
            list.add(str);
        }
        for (int i = 0; i < 4; i++) {
            System.out.print("第"+(i+1)+"组的队伍有：");
            for (int j = 0; j <4; j++) {
                String s = list.get(rand.nextInt(list.size()));
                list.remove(s);
                System.out.print(s+"、");
            }
            System.out.println();
        }
    }
}
